/**
 * Created by lintao_alex on 2018/8/29
 */


namespace game {
    import BaseModel = mengdao.BaseModel;
    import IRequestBack = mengdao.IRequestBack;

    export class BarModel extends BaseModel{
        public cnt=0;
        public requestData(onBack:IRequestBack){
            setTimeout(()=>{
                if(Math.random()>0.5){
                    this.cnt++;
                    onBack.onSuccess.call(onBack.callObj);
                }else if(onBack.onFail){
                    egret.log('bar request fail')
                    onBack.onFail.call(onBack.callObj);
                }
            }, 2000)
        }
    }
}